<?php
/*
	消息通知设置
	参数：$msgtype,$newsmsg,$tpldata,$uid,$url,$color
*/
defined('BY_JYA') or exit('error');
list($msgtype,$newsmsg,$tpldata,$uid,$url,$color)=$arguments;
$tpl=$this->plugin_setting('message_tpl');
if($msgtype=='order_new'){
	if($tpl['order_new'] && $tpl['istpl']){
		cfc('account')->sendTplNotice($uid,$tpl['order_new'],$tpldata,$url,$color);
		return true;
	}else{
		cfc('account')->sendCustomNotice($newsmsg,$uid);
		return true;
	}
}elseif($msgtype=='order_pay'){
	if($tpl['order_pay'] && $tpl['istpl']){
		cfc('account')->sendTplNotice($uid,$tpl['order_pay'],$tpldata,$url,$color);
		return true;		
	}else{
		cfc('account')->sendCustomNotice($newsmsg,$uid);
		return true;
	}
	
}elseif($msgtype=='order_change'){
	if($tpl['order_change'] && $tpl['istpl']){
		cfc('account')->sendTplNotice($uid,$tpl['order_change'],$tpldata,$url,$color);	
		return true;
	}else{
		cfc('account')->sendCustomNotice($newsmsg,$uid);
		return true;
	}
	
}elseif($msgtype=='waiter'){
	if($tpl['waiter'] && $tpl['istpl']){
		cfc('account')->sendTplNotice($uid,$tpl['waiter'],$tpldata,$url,$color);
		return true;		
	}else{
		cfc('account')->sendCustomNotice($newsmsg,$uid);
		return true;
	}
	
}elseif($msgtype=='queue_update'){
	if($tpl['queue_update'] && $tpl['istpl']){
		cfc('account')->sendTplNotice($uid,$tpl['queue_update'],$tpldata,$url,$color);	
		return true;
	}else{
		cfc('account')->sendCustomNotice($newsmsg,$uid);
		return true;
	}
	
}elseif($msgtype=='call'){
	if($tpl['call'] && $tpl['istpl']){
		cfc('account')->sendTplNotice($uid,$tpl['call'],$tpldata,$url,$color);	
		return true;
	}else{
		cfc('account')->sendCustomNotice($newsmsg,$uid);
		return true;
	}
}elseif($msgtype=='queue_update'){
	if($tpl['queue_update'] && $tpl['istpl']){
		cfc('account')->sendTplNotice($uid,$tpl['queue_update'],$tpldata,$url,$color);	
		return true;
	}else{
		cfc('account')->sendCustomNotice($newsmsg,$uid);
		return true;
	}
}elseif($msgtype=='salf_order_new'){
	if($tpl['salf_order_new'] && $tpl['istpl']){
		cfc('account')->sendTplNotice($uid,$tpl['salf_order_new'],$tpldata,$url,$color);	
		return true;
	}else{
		cfc('account')->sendCustomNotice($newsmsg,$uid);
		return true;
	}
}elseif($msgtype=='qu_order'){
	if($tpl['qu_order'] && $tpl['istpl']){
		cfc('account')->sendTplNotice($uid,$tpl['qu_order'],$tpldata,$url,$color);	
		return true;
	}else{
		cfc('account')->sendCustomNotice($newsmsg,$uid);
		return true;
	}
}elseif($msgtype=='yuding_order_new'){
	if($tpl['yuding_order_new'] && $tpl['istpl']){
		cfc('account')->sendTplNotice($uid,$tpl['yuding_order_new'],$tpldata,$url,$color);	
		return true;
	}else{
		cfc('account')->sendCustomNotice($newsmsg,$uid);
		return true;
	}
}elseif($msgtype=='kf_order_pay'){
	if($tpl['kf_order_pay'] && $tpl['istpl']){
		cfc('account')->sendTplNotice($uid,$tpl['kf_order_pay'],$tpldata,$url,$color);	
		return true;
	}else{
		cfc('account')->sendCustomNotice($newsmsg,$uid);
		return true;
	}
}elseif($msgtype=='kf_order_new'){
	if($tpl['kf_order_new'] && $tpl['istpl']){
		cfc('account')->sendTplNotice($uid,$tpl['kf_order_new'],$tpldata,$url,$color);	
		return true;
	}else{
		cfc('account')->sendCustomNotice($newsmsg,$uid);
		return true;
	}
}elseif($msgtype=='kf_waiter'){
	if($tpl['kf_waiter'] && $tpl['istpl']){
		cfc('account')->sendTplNotice($uid,$tpl['kf_waiter'],$tpldata,$url,$color);	
		return true;
	}else{
		cfc('account')->sendCustomNotice($newsmsg,$uid);
		return true;
	}
}